import { rcaNumberFormat,get_month_first,get_date } from './common.js'
import { commonTableOption } from './common.js'
export const startDate = get_month_first(0);
export const endDate = get_date(0);
export const tableOption = {
  ...commonTableOption,
  column: [{
    label: 'id',
    prop: 'id',
    hide: true,
    display: false
  }, {
    type: 'select',
    label: '线路',
    prop: 'lineCode',
    dicQuery: { allLine: true },
    dicUrl: '/support/swparamline/dict',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    display: true // 动态显隐控制不能删除
  }, {
    type: 'date',
    label: '结算日期',
    prop: 'settlementTime',
    searchValue: [startDate, endDate], 
    searchSpan: 12,
    searchRange: true,
    search: true,
    valueFormat: 'yyyy-MM-dd',
  }, {

    type: 'input',
    showSummary: true,
    label: '发售数量(张)',
    prop: 'totalNumberSales'
  }, {

    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value)
    },
    label: '小计金额',
    prop: 'subtotalTotal',
  }]
}

const currentMonth1stDate = new Date();
currentMonth1stDate.setDate(1);
currentMonth1stDate.setHours(0);
currentMonth1stDate.setSeconds(0);
currentMonth1stDate.setMinutes(0);
export const defaultStartDate = currentMonth1stDate;
